<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWeekProfitReturnTable extends Migration
{
    /**
     * Run the migrations.
     * 佣金结算表
     * @return void
     */
    public function up()
    {
        Schema::create('week_profit_return', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->comment('用户ID');
            $table->decimal('profit_count',16,4)->default(0)->comment('佣金相加');
            $table->decimal('zt_volume',16,4)->default(0)->comment('直推手数结算');
            $table->decimal('yj_volume',16,4)->default(0)->comment('团队业绩手数结算');
            $table->decimal('zt_profit',16,4)->default(0)->comment('直推业绩分红');
            $table->decimal('yj_profit',16,4)->default(0)->comment('团队业绩分红');
            $table->decimal('tj_profit',16,4)->default(0)->comment('同级佣金');
            $table->tinyInteger('ismail')->default(1)->comment('1未返2已返');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('week_profit_return');
    }
}
